import type { Module } from 'vuex'

import { accountLoginRequest } from '@/api/login/login'

import type { ILoginState } from './types'
import type { IRootState } from '../types'
const login: Module<ILoginState, IRootState> = {
  namespaced: true,
  state() {
    return {
      token: 'test',
      username: ''
    }
  },
  getters: {},
  mutations: {},
  actions: {
    // 登录逻辑
    async accountLoginAction({ commit }, accountInfo) {
      const res = await accountLoginRequest({ ...accountInfo })
      console.log(res)
    }
  }
}
export default login
